//
//  Item.swift
//  AutoModel
//
//  Created by 好米有易 on 2019/8/13.
//  Copyright © 2019 own. All rights reserved.
//

import Cocoa

class Item: NSCollectionViewItem {

    lazy var titleLabel: NSTextField = {
        let titleLabel = NSTextField(frame: NSRect(x: 10, y: 10, width: 200, height: 24))
        titleLabel.stringValue = "1243333132444444444444444444444444444444444444444"
        titleLabel.isBordered = false
        titleLabel.isEditable = false
        titleLabel.font =  NSFont.systemFont(ofSize: 22)
        titleLabel.backgroundColor = NSColor.clear
        titleLabel.sizeToFit()
        return titleLabel
    }()

    override func loadView() {

        self.view = NSView.init()
    }

    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.addSubview(titleLabel)
        self.view.set(color: NSColor.red)
        self.view.layer?.cornerRadius = 5
        self.view.layer?.borderWidth = 1
        self.view.layer?.borderColor = NSColor.green.cgColor
        self.view.layer?.masksToBounds = true

    }
    
}
